<script setup lang='ts'>
import { ref } from 'vue';
import {formatTimestamp} from '@/utils/common.js'
	defineProps({
		more: {
			type: Boolean,
			defalut: false
		},
		item: {
			type: Object,
			default() {
				return {}
			}
		}
	})
	
	
</script>


<template>
	<view class="theme-item">
		<navigator class="box" :url="`/pages/classList/classList?id=${item._id}&name=${item.name}`" v-if="!more">
			<image class="pic" :src="item.picurl" mode="widthFix"></image>
			<view class="model">{{item.name}}</view>
			<view class="tab" v-if="formatTimestamp(item.updateTime)">{{formatTimestamp(item.updateTime)  + '更新'}}</view>
		</navigator>
		<navigator class="box more" open-type="reLaunch" url="/pages/classify/classify" v-else>
			<image class="pic" src="/common/images/more.jpg" mode="widthFix"></image>
			<view class="model">
				<uni-icons color="#fff" type="more-filled" size="33"></uni-icons>
				<view class="text">
					更多
				</view>
			</view>
		</navigator>
	</view>
</template>


<style scoped lang='scss'>
	.theme-item{
		.box{
			position: relative;
			height: 340rpx;
			overflow: hidden;
			border-radius: 10rpx;
			&.more{
				.model{
					display: flex;
					justify-content: center;
					align-items: center;
					flex-direction: column;
					width: 100%;
					height: 100%;
					line-height: 1;
					.text{
						font-size: 28rpx;
					}
				}
			}
			.pic{
				width: 100%;
				height: 100%;
			}
			.model{
				width: 100%;
				height: 70rpx;
				position: absolute;
				bottom: 0;
				left: 0;
				text-align: center;
				line-height: 70rpx;
				color: #fff;
				font-size: 28rpx;
				font-weight: bold;
				background-color: rgba(0, 0, 0, .2);
				backdrop-filter: blur(20rpx);
			}
			.tab{
				position: absolute;
				left: 0;
				top: 0;
				background-color: rgba(250, 129, 59, .7);
				backdrop-filter: blur(20rpx);
				font-size: 22rpx;
				padding: 6rpx 14rpx;
				color: #fff;
				border-radius: 0 0 15rpx 0;
			}
		}
		
		
	}
</style>